package com.bst.common.utils;

import com.bst.common.core.domain.entity.SysUser;
import org.apache.shiro.SecurityUtils;

public class LoginAPIUtil {

    public static Long getLoginUserId() {
        SysUser user = (SysUser) SecurityUtils.getSubject().getPrincipal();
        return user==null?null:user.getUserId();
    }

    public static String getLoginUsename() {
        SysUser user = (SysUser) SecurityUtils.getSubject().getPrincipal();
        return user==null?null:user.getUserName();
    }

    public static String getLoginName() {
        SysUser user = (SysUser) SecurityUtils.getSubject().getPrincipal();
        return user==null?null:user.getLoginName();
    }
}
